package com.bw.mvvm_common.mvvm.network;

import java.util.concurrent.TimeUnit;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;

public
/**
 * @author Guan
 * @description:
 * @date :2021/9/8 0008 下午 4:40
 *公共OKhttpclient
 * 三个超时
 * 日志拦截器
 *
 */


abstract class Baseimpl implements Httpinterface{
    protected OkHttpClient.Builder creatOkhttpBuilder(){

        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY);
        builder.addInterceptor(httpLoggingInterceptor);
        builder.writeTimeout(30, TimeUnit.SECONDS);
        builder.connectTimeout(30,TimeUnit.SECONDS);
        builder.readTimeout(30,TimeUnit.SECONDS);

        return builder;

    }

}
